

/* 

 >>>>>>>   MASTER DOFILE FOR : 

Paper: Gentrification and pioneer businesses 
Authors: Behrens, Boualam, Martin, Mayneris 

Name dofile: master_restat_pioneers.do  
Version: 23 nov. 2021 

Final output: 
- tables 1 to 7 of the paper 
- figures 1 and 2 of the paper 

*/ 


////////////////////////////////////////////////////////////////////////////
//
// Step 1: Data management
// Produces the datasets used in the empirical analysis
//
////////////////////////////////////////////////////////////////////////////

// Establishment data

do prepare_NETS_NewYork.do
* extract information on establishments in NY from raw NETS data 

do prepare_blockvar_philadelphia_boston.do
* extract information on establishments in Philly from raw NETS data 

// Census data

do prepare_blockvar_education.do
* apportionement of blockgroup-level census data on education to blocks contained in blockgroups 
 
do prepare_blockvar_race.do 
* apportionement of blockgroup-level census data on education to blocks contained in blockgroups 

do prepare_blockvar_income.do 
* apportionement of blockgroup-level census data on education to blocks contained in blockgroups 

do prepare_blockvar_housing.do 
* apportionement of blockgroup-level census data on education to blocks contained in blockgroups 

do create_db_concordedblocks.do 
* put together geography, establishment data, and demographic info on residents at the concorded block level

do identify_gentri_blocks.do 
* identify gentrifying blocks in NYC 

do prepare_variables4reg.do 
* combine data on establishments, geography and demographics for NY computed with rings around concorded blocks

do create_db_blockgroups.do
* put together geography, establishment data, and demographic info on residents at the blockgroup level

do create_db_concordedblocks_philly.do 
* put together geography, establishment data, and demographic info on residents for Philly at the concorded block level

do identify_gentri_blocks_philly.do 
* identify gentrifying blocks in Philly

do prepare_variables4reg_philly.do 
* combine data on establishments, geography and demographics for Philly computed with rings around concorded blocks

////////////////////////////////////////////////////////////////////////////
//
// Step 2: Identify pioneers
// Output found in section 3.1 
//
////////////////////////////////////////////////////////////////////////////


do compute_elasticity_negbin.do 
* dofile to estimate the elasticity of the number of establishments to income and future gentrification 

do identify_pioneers_negbin.do
*  baseline definition of pioneers
 
do table1.do 
* produces table 1 (section 3.1)

do table2.do 
* produces table 2 (section 3.1)

do identify_pioneers_negbin_alt.do  
* alternative definition of pioneers that does not take into account income elasticity

do identify_pioneers_negbin_med.do
* alternative definition of pioneers using the median growth of income or edu rather than the weighted average

do compute_elasticity_logit.do 
* alternative specification using a logit rather than a negative binomial 

do identify_pioneers_logit.do
* alternative definition of pioneers using estimates from a logit 

do compute_elasticity_negbinblkgp.do 
* alternative specficiation run at the blockgroup level

do identify_pioneers_blkgr.do 
* alternative definition of pioneers using estimates obtained at the blockgroup level 
 
do table3.do  
* produces table 3 (section 3.1)


////////////////////////////////////////////////////////////////////////////
//
// Step 3: Pioneers herald gentrification  
// Output found in sections 3.2 3.3 3.4 
//
////////////////////////////////////////////////////////////////////////////

do create_db_table4.do
* prepare the dataset used to run regressions of gentrification proxies on past presence of pioneers (NYC)

do table4.do
* produces table 4 on pioneers and gentrification in NY 2000-2010 

do create_db_table5.do
* prepare the dataset used to run regressions of gentrification proxies on past presence of pioneers (Philly)

do table5.do
* produces table 5 on pioneers and gentrification in Philly 2000-2010 

////////////////////////////////////////////////////////////////////////////
//
// Step 4: Why pionners matter for gentrification 
// Output found in sections 4.1 4.2 4.3 
//
////////////////////////////////////////////////////////////////////////////


do figure1.do
* produces figure 1 (section 4.1)

do figure2.do
* produces figure 2 (section 4.2)

do table6.do 
* produces table 6 (section 4.3)

do table7.do 
* produces table 7 (section 4.3)

